<?php echo  $form->create('Kehoaches')?>
<div class="kehoaches">
	<h2 style="margin-bottom: 0px;"><?php __('Giao chỉ tiêu của '.$tendvs[0]['donvis']['tendv']);?></h2>
	<div style="margin-bottom: 0px;"><?php
	echo $form->input('root',array('id'=>'root','type'=>'hidden','value'=>$this->webroot));
		if(empty($nams))
			$nams =array(); 
		echo $form->input('nam',array('id'=>'nam','label'=>'Năm','options'=>$nams,'empty'=>"Chọn Năm",'selected'=>date('Y')));?>
	</div>
	<h3 style="margin-top: 0px;">Xin vui lòng kiểm tra thời gian bạn muốn lập kế hoạch đã tồn tại hay chưa</h3>
	<div id='tbltg' style="margin-top: 0px;">
	<table cellpadding="0" cellspacing="0" id="tables">

	<tr>
			<th><?php echo 'STT';?></th>
			<th><?php echo 'Thời Gian';?></th>
			<th class="actions"><?php __('Lựa chọn');?></th>
	</tr>
	<?php
	$i = 0;
	foreach ($kehoachthangs as $kehoachthang):
		$thanght = date('m',strtotime($kehoachthang['Thoigian']['ngaykt']));
		$class = null;
		$id=null;
		$align =null;
		$i++;
	?>
	<tr<?php echo $class.$id;?>>
		<td ><?php echo $i;?></td>
		<td <?php echo $align?>>
			<?php echo '<strong>'.$kehoachthang['Thoigian']['thoigian'].'</strong>'; ?>
		</td>
       
        
		<td class="actions">
			<?php 
                    	echo $this->Html->link(__('Lũy Kế Tổng Hợp', true), array('controller'=>'kqbanhangtts','action' => 'luyketonghop', $kehoachthang['Kehoach']['id']));
                    ?>
		</td>
		
	</tr>
	<?php
	endforeach; ?>
	</table>
</div>
</div>
<?php
$this->Js->get('#nam')->event('change',
								$this->Js->request(array('controller' => 'kehoaches', 'action' => 'laytheodoilk',$donvi),
								array('update' => '#tbltg','async' => true,
								'dataExpression' => true,'method' => 'post',
								'data' => $js->serializeForm(array('isForm' => true, 'inline' => true))))); 
echo $form->end();
?>
